package service;

import pojo.Favourite;

import java.sql.SQLException;
import java.util.ArrayList;

public interface FavouriteService {
    /**
     * favourite表中某用户所有数据
     *
     * @param uid
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Favourite> favourites(Integer uid) throws SQLException, ClassNotFoundException;

    /**
     * 用户收藏笔记
     *
     * @param uid
     * @param nid
     * @return
     * @throws SQLException
     */
    boolean userFavouriteNote(Integer uid, Integer nid) throws SQLException;

    /**
     * 某笔记收藏数
     *
     * @param nid
     * @return
     * @throws SQLException
     */
    Integer noteFavourites(Integer nid) throws SQLException;

    /**
     * 判断用户是否收藏某笔记
     *
     * @param uid
     * @param nid
     * @return
     * @throws SQLException
     */
    boolean isFavourite(Integer uid, Integer nid) throws SQLException;

    /**
     * 取消收藏
     *
     * @param uid
     * @param nid
     * @return
     * @throws SQLException
     */
    boolean UserUnFavourite(Integer uid, Integer nid) throws SQLException;
}
